package com.hps.demo.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author heps
 * @since 2020/11/11 10:04
 */
@Getter
@AllArgsConstructor
public enum GenderEnum {
  MALE(1, "male"),
  FEMALE(2, "female")
  ;

  private int code;

  private String message;

  public static String getMessage(int code) {
    for (GenderEnum value : values()) {
      if (value.getCode() == code) {
        return value.getMessage();
      }
    }
    return null;
  }
}
